<?php /* Smarty version Smarty-3.1.12, created on 2016-05-17 18:03:59
         compiled from "/home/weixincn86dwleoi1xmibn6cinm896/wwwroot/dm/xycms/link.tpl" */ ?>
<?php /*%%SmartyHeaderCode:1461520816573aec8f55a4e7-90197783%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    'cce2070551eec7682810751cd51fa15a41b1b0c7' => 
    array (
      0 => '/home/weixincn86dwleoi1xmibn6cinm896/wwwroot/dm/xycms/link.tpl',
      1 => 1429337897,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '1461520816573aec8f55a4e7-90197783',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'page_charset' => 0,
    'copyright_author' => 0,
    'action' => 0,
    'link' => 0,
    'volist' => 0,
    'total' => 0,
    'pagecount' => 0,
    'showpage' => 0,
    'orders' => 0,
    'flag_checkbox' => 0,
    'api' => 0,
    'comeurl' => 0,
    'id' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.12',
  'unifunc' => 'content_573aec8f777d57_48616794',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_573aec8f777d57_48616794')) {function content_573aec8f777d57_48616794($_smarty_tpl) {?><?php if (!is_callable('smarty_modifier_date_format')) include '/home/weixincn86dwleoi1xmibn6cinm896/wwwroot/source/core/plugins/modifier.date_format.php';
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $_smarty_tpl->tpl_vars['page_charset']->value;?>
" />
<title>友情链接</title>
<meta name="author" content="<?php echo $_smarty_tpl->tpl_vars['copyright_author']->value;?>
" />
<link type="text/css" rel="stylesheet" href="xycms/css/admin.css" media="screen" />
<script type='text/javascript' src='js/jquery-1.8.3.min.js'></script>
<script type='text/javascript' src='js/command.js'></script>
<script type="text/javascript" src='../data/editor/kindeditor.js'></script>
</head>
<body>
<?php if ($_smarty_tpl->tpl_vars['action']->value==''){?>
<div class="main-wrap">
  <div class="path"><p>当前位置：优化中心<span>&gt;</span>友情链接</p></div>
  <div class="main-cont">
    <h3 class="title"><a href="xycms_link.php?action=add" class="btn-general">添加友情链接</a>友情链接</h3>
	<form action="xycms_link.php" method="post" name="myform" id="myform" style="margin:0">
	<input type="hidden" name="action" id="action" value="del" />
    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="table" align="center">
	  <thead class="tb-tit-bg">
	  <tr>
	    <th width="8%"><div class="th-gap">选择</div></th>
		<th width="15%"><div class="th-gap">网站名称</div></th>
		<th width="15%"><div class="th-gap">LOGO预览</div></th>
		<th width="20%"><div class="th-gap">网站URL</div></th>
		<th width="8%"><div class="th-gap">排序</div></th>
		<th width="8%"><div class="th-gap">状态</div></th>
		<th width="12%"><div class="th-gap">录入时间</div></th>
		<th><div class="th-gap">操作</div></th>
	  </tr>
	  </thead>
	  <tfoot class="tb-foot-bg"></tfoot>
	  <?php  $_smarty_tpl->tpl_vars['volist'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['volist']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['link']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['volist']->key => $_smarty_tpl->tpl_vars['volist']->value){
$_smarty_tpl->tpl_vars['volist']->_loop = true;
?>
	  <tr onmouseover="overColor(this)" onmouseout="outColor(this)">
	    <td align="center"><input name="id[]" type="checkbox" value="<?php echo $_smarty_tpl->tpl_vars['volist']->value['linkid'];?>
" onclick="checkItem(this, 'chkAll')" /></td>
		<td align="left"><?php echo $_smarty_tpl->tpl_vars['volist']->value['linktitle'];?>
</td>
		<td align="center"><?php if ($_smarty_tpl->tpl_vars['volist']->value['linktype']==1){?>文字链接<?php }else{ ?><a href="../<?php echo $_smarty_tpl->tpl_vars['volist']->value['logoimg'];?>
" target="_blank"><img src="../<?php echo $_smarty_tpl->tpl_vars['volist']->value['logoimg'];?>
" width="88" height="31" /></a><?php }?></td>
		<td align="left"><a href="<?php echo $_smarty_tpl->tpl_vars['volist']->value['linkurl'];?>
" target="_blank"><?php echo $_smarty_tpl->tpl_vars['volist']->value['linkurl'];?>
</a></td>
		<td align="center"><?php echo $_smarty_tpl->tpl_vars['volist']->value['orders'];?>
</td>
		<td align="center">
		<?php if ($_smarty_tpl->tpl_vars['volist']->value['flag']==0){?>
			<input type="hidden" id="attr_flag<?php echo $_smarty_tpl->tpl_vars['volist']->value['linkid'];?>
" value="flagopen" />
			<img id="flag<?php echo $_smarty_tpl->tpl_vars['volist']->value['linkid'];?>
" src="xycms/images/no.gif" onclick="javascript:fetch_ajax('flag','<?php echo $_smarty_tpl->tpl_vars['volist']->value['linkid'];?>
');" style="cursor:pointer;" />
		<?php }else{ ?>
			<input type="hidden" id="attr_flag<?php echo $_smarty_tpl->tpl_vars['volist']->value['linkid'];?>
" value="flagclose" />
			<img id="flag<?php echo $_smarty_tpl->tpl_vars['volist']->value['linkid'];?>
" src="xycms/images/yes.gif" onclick="javascript:fetch_ajax('flag','<?php echo $_smarty_tpl->tpl_vars['volist']->value['linkid'];?>
');" style="cursor:pointer;" />	
		<?php }?>
        </td>
		<td><?php echo smarty_modifier_date_format($_smarty_tpl->tpl_vars['volist']->value['timeline'],"%Y/%m/%d");?>
</td>
		<td align="center"><a href="xycms_link.php?action=edit&id=<?php echo $_smarty_tpl->tpl_vars['volist']->value['linkid'];?>
&page=<!--
{$page}-->" class="icon-edit">编辑</a>&nbsp;&nbsp;<a href="xycms_link.php?action=del&id[]=<?php echo $_smarty_tpl->tpl_vars['volist']->value['linkid'];?>
" onclick="{if(confirm('确定要删除该信息?')){return true;} return false;}" class="icon-del">删除</a></td>
	  </tr>
	  <?php }
if (!$_smarty_tpl->tpl_vars['volist']->_loop) {
?>
      <tr>
	    <td colspan="8" align="center">暂无信息</td>
	  </tr>
	  <?php } ?>
	  <?php if ($_smarty_tpl->tpl_vars['total']->value>0){?>
	  <tr>
		<td align="center"><input name="chkAll" type="checkbox" id="chkAll" onclick="checkAll(this, 'id[]')" value="checkbox" /></td>
		<td class="hback" colspan="7"><input class="button" name="btn_del" type="button" value="删 除" onclick="{if(confirm('确定删除选定信息吗!?')){$('#action').val('del');$('#myform').submit();return true;}return false;}" class="button" /></td>
	  </tr>
	  <?php }?>
	</table>
	</form>
	<?php if ($_smarty_tpl->tpl_vars['pagecount']->value>1){?>
	<table width='95%' border='0' cellspacing='0' cellpadding='0' align='center' style="margin-top:10px;">
	  <tr>
		<td align='center'><?php echo $_smarty_tpl->tpl_vars['showpage']->value;?>
</td>
	  </tr>
	</table>
	<?php }?>
  </div>
</div>
<?php }?>

<?php if ($_smarty_tpl->tpl_vars['action']->value=="add"){?>
<div class="main-wrap">
  <div class="path"><p>当前位置：优化中心<span>&gt;</span>添加友情链接</p></div>
  <div class="main-cont">
	<h3 class="title"><a href="xycms_link.php" class="btn-general">返回列表</a>添加友情链接</h3>
    <form name="myform" id="myform" method="post" action="xycms_link.php" onsubmit='return checkform();'>
    <input type="hidden" name="action" value="saveadd" />
	<table class='table_form'>
	  <tr>
		<td width="80">网站名称 <span class='f_red'>*</span></td>
		<td><input type="text" name="linktitle" id="linktitle" class="input-txt" /> <span id='dlinktitle' class='f_red'></span></td>
	  </tr>
	  <tr>
		<td>网站URL <span class="f_red">*</span> </td>
		<td><input type="text" name="linkurl" id="linkurl" class="input-txt" /> （以 http:// 开头） <span id='dlinkurl' class='f_red'></span></td>
	  </tr>
	  <tr>
		<td>链接类型 <span class="f_red">*</span></td>
		<td><select name="linktype" id="linktype"><option value="1">文字链接</option><option value="2">LOGO链接</option></select> <span id='dlinktype' class='f_red'></span></td>
	  </tr>
	  <tr>
		<td>LOGO图片 <span class="f_red"></span> </td>
		<td>
		  <input type="hidden" name="uploadfiles" id="uploadfiles" />
		  <img class='upload_img' /><a href="javascript:volid(0)" class="pic_remove">删除</a>
		  <iframe id='iframe_t' frameborder='0' scrolling='no' width='450' height='25' src='upload_input.php?filepath=link&is_thumb=2'></iframe>	
		</td>
	  </tr>
	  <tr>
		<td>网站排序 </td>
		<td><input type="text" name="orders" id="orders" class="input-s" value="<?php echo $_smarty_tpl->tpl_vars['orders']->value;?>
" />  <span id='dorders' class='f_red'></span></td>
	  </tr>
	  <tr>
		<td>状态设置 </td>
		<td><?php echo $_smarty_tpl->tpl_vars['flag_checkbox']->value;?>
</td>
	  </tr>
	  <tr>
		<td>网站描述</td>
		<td><textarea name="intro" id="intro" style='width:60%;height:65px;display:;overflow:auto;'></textarea>  <span id='dintro' class='f_red'></span></td>
	  </tr>
	  <tr>
		<td></td>
		<td><input type="submit" name="btn_save" class="button" value="添加保存" /></td>
	  </tr>
	</table>
	</form>
  </div>
  <div style="clear:both;"></div>
</div>
<?php }?>

<?php if ($_smarty_tpl->tpl_vars['action']->value=="config"){?>
<div class="main-wrap">
  <div class="path"><p>当前位置：优化中心<span>&gt;</span>友情链接库配置</p></div>
  <div class="main-cont">
	<h3 class="title">友情链接库配置<a href="xycms_link.php?action=del_cache" id="del_cache">删除链接库缓存</a></h3>
    <form name="myform" id="myform" method="post" action="xycms_link.php">
    <input type="hidden" name="action" value="config" />
	<table class='table_form'>
	  <tr>
		<td width=110>链接库API地址 </td>
		<td><input type="text" name="api_url" class="input-txt link_api" value="<?php echo $_smarty_tpl->tpl_vars['api']->value['api_url'];?>
" /></td>
	  </tr>
	  <tr>
		<td>Token(令牌)</td>
		<td><input type="text" name="token" class="input-txt link_api" value="<?php echo $_smarty_tpl->tpl_vars['api']->value['token'];?>
" /></td>
	  </tr>
	  <tr>
		<td>关闭外链推送</td>
		<td>
		<input type="checkbox" name="closeLink" value="1"<?php if ($_smarty_tpl->tpl_vars['api']->value['closeLink']==1){?> checked="checked"<?php }?> />
		</td>
	  </tr>
	  <tr>
		<td></td>
		<td><input type="submit" name="dosubmit" class="button" value="保存" /></td>
	  </tr>
	</table>
	</form>
  </div>
  <div style="clear:both;"></div>
</div>
<?php }?>

<?php if ($_smarty_tpl->tpl_vars['action']->value=="edit"){?>
<div class="main-wrap">
  <div class="path"><p>当前位置：优化中心<span>&gt;</span>编辑友情链接</p></div>
  <div class="main-cont">
	<h3 class="title"><a href="xycms_link.php?<?php echo $_smarty_tpl->tpl_vars['comeurl']->value;?>
" class="btn-general">返回列表</a>编辑友情链接</h3>
    <form name="myform" id="myform" method="post" action="xycms_link.php" onsubmit='return checkform();'>
    <input type="hidden" name="action" value="saveedit" />
	<input type="hidden" name="id" value="<?php echo $_smarty_tpl->tpl_vars['id']->value;?>
" />
	<table class='table_form'>
	  <tr>
		<td width="80">网站名称 <span class='f_red'>*</span></td>
		<td><input type="text" name="linktitle" id="linktitle" class="input-txt" value="<?php echo $_smarty_tpl->tpl_vars['link']->value['linktitle'];?>
" /> <span id='dlinktitle' class='f_red'></span></td>
	  </tr>
	  <tr>
		<td>网站URL <span class="f_red">*</span> </td>
		<td><input type="text" name="linkurl" id="linkurl" class="input-txt" value="<?php echo $_smarty_tpl->tpl_vars['link']->value['linkurl'];?>
" /> （以 http:// 开头） <span id='dlinkurl' class='f_red'></span></td>
	  </tr>
	  <tr>
		<td>链接类型 <span class="f_red">*</span></td>
		<td><select name="linktype" id="linktype"><option value="">==请选择==</option><option value="1"<?php if ($_smarty_tpl->tpl_vars['link']->value['linktype']==1){?> selected<?php }?>>文字链接</option><option value="2"<?php if ($_smarty_tpl->tpl_vars['link']->value['linktype']==2){?> selected<?php }?>>LOGO链接</option></select> <span id='dlinktype' class='f_red'></span></td>
	  </tr>
	  <tr>
		<td>LOGO图片 <span class="f_red"></span> </td>
		<td>
		  <input type="hidden" name="uploadfiles" id="uploadfiles"  value="<?php echo $_smarty_tpl->tpl_vars['link']->value['logoimg'];?>
" />
		  <?php if ($_smarty_tpl->tpl_vars['link']->value['logoimg']!=''){?>
		  	 <img class='upload_img' src="../<?php echo $_smarty_tpl->tpl_vars['link']->value['logoimg'];?>
" />
		  <?php }else{ ?>
		     <img class='upload_img' /> 
		  <?php }?>
		  <a href="javascript:volid(0)" class="pic_remove">删除</a>
		  <iframe id='iframe_t' frameborder='0' scrolling='no' width='450' height='25' src='upload_input.php?filepath=link&is_thumb=2'></iframe>
		  <script type="text/javascript">
		   var t = "<?php echo $_smarty_tpl->tpl_vars['link']->value['logoimg'];?>
";
		    if(t != ''){
		    	$(".upload_img").css("display","block");
		    	$(".pic_remove").css("display","block");
		    	$("#iframe_t").css("display","none");
		    }
		  </script>	
		</td>
	  </tr>
	  <tr>
		<td>网站排序 </td>
		<td><input type="text" name="orders" id="orders" class="input-s" value="<?php echo $_smarty_tpl->tpl_vars['link']->value['orders'];?>
" />  <span id='dorders' class='f_red'></span></td>
	  </tr>
	  <tr>
		<td>状态设置 </td>
		<td><?php echo $_smarty_tpl->tpl_vars['flag_checkbox']->value;?>
</td>
	  </tr>
	  <tr>
		<td>网站描述</td>
		<td><textarea name="intro" id="intro" style='width:60%;height:65px;display:;overflow:auto;'><?php echo $_smarty_tpl->tpl_vars['link']->value['intro'];?>
</textarea>  <span id='dintro' class='f_red'></span></td>
	  </tr>
	  <tr>
		<td></td>
		<td><input type="submit" name="btn_save" class="button" value="更新保存" /></td>
	  </tr>
	</table>
	</form>
  </div>
  <div style="clear:both;"></div>
</div>
<?php }?>
<script type="text/javascript">
function checkform() {
	var t = "";
	var v = "";

	t = "linktitle";
	v = $("#"+t).val();
	if(v=="") {
		dmsg("网站名称不能为空", t);
		return false;
	}
	t = "linkurl";
	v = $("#"+t).val();
	if(v=="") {
		dmsg("网站URL不能为空", t);
		return false;
	}
	t = "linktype";
	v = $("#"+t).val();
	if(v=="") {
		dmsg("请选择链接类型", t);
		return false;
	}
	return true;
}
</script>
</body>
</html><?php }} ?>